_report_errors true

_procedure terminal_exit

	teleport_player 33 
end

_procedure init

	vacTime: define false
	playerOxy: define 0
	
	animTime: define false
	pathTime: define false
	
	tempVal: define 0
	
	Init_Cameras 2
	Init_Paths 1
	
	New_Path 1, 3
	
	Select_Path 1
	Set_Path_Move_Speed 100
	Set_Path_Roll_Speed 100
	
	Select_Point 0
	
	Set_Point_Poly 17
	Set_Point_Pos 2.269, -12.196, 0.6
	Set_Point_YP 84.375, 0
	
	Select_Point 1
	
	Set_Point_Poly 8
	Set_Point_Pos 2.649, 2.637, 0.6
	Set_Point_YP -15.469, 0
	
	Select_Point 2
	
	Set_Point_Poly 4
	Set_Point_Pos 9.626, 1.275, 2.1
	Set_Point_YP 8.438, 7.734

	
	Select_Camera 1
	Set_Camera_Poly 7
	Set_Camera_Pos -4.981, 5.008, 2.6
	Set_Camera_YP -54.844, -6.328		
	
	use_camera default_camera

	
end

_procedure tag_switch

	block_start
	
	get_my_value tempVal
	
	if_= tempVal, 1, checkVac
	
	get_tag_state 2, pathTime
	jump noChange
	
	checkVac: set animTime, vacTime
	get_tag_state 1, vacTime
	if_= animTime, vacTime, noChange
	if_= vacTime, false, noChange
	set animTime, true
	
	noChange: block_end

end

_procedure idle

	
	
	if_!= vacTime, true, skipIt 
	if_= animTime, true, doAnim
	if_= pathTime, true, doPath
	
	get_oxygen playerOxy
	subtract playerOxy, 10
	set_oxygen playerOxy
	jump skipIt
	
	doAnim: use_camera 1
	wait_ticks 300
	use_camera default_camera
	set animTime, false
	jump skipIt
	
	doPath: select_camera 2
	start_camera_on_path 1
	wait_for_path
	set pathTime, false

skipIt: end
